<template>
	<view class="x-main-content">
		<u-navbar bgColor="#fff" :fixed="true" leftIconColor="#000" leftIconSize="42rpx" autoBack placeholder
			title="投诉建议">
		</u-navbar>
		<view style="padding: 40rpx;">
			<view style="background-color: #fff;padding: 20rpx 20rpx 30rpx 20rpx;border-radius: 20rpx;">
				<view class="">
					我要反馈
				</view>
				<view style="margin-top: 20rpx;position: relative;">
					<textarea v-model="content" cols="30" rows="10"
						style="border: 2px solid #bfc7d1;border-radius: 20rpx;padding:10rpx;font-size: 26rpx;"
						maxlength="200" placeholder="请输入您需要反馈的内容"></textarea>
					<view style="position: absolute;bottom: 20rpx;right: 20rpx;font-size: 24rpx;color:#bfc7d1">
						{{content.length}}/200
					</view>
				</view>
			</view>
		</view>
		<view class="toConfirm">
			<view class="btn-confirm" @click="toSubmit">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: ''
			}
		},
		methods: {
			toSubmit() {
				if (this.content) {
					uni.showToast({
						icon: 'success',
						title: '提交成功',
						success: res => {
							this.content = ''
							uni.navigateBack({
								delta: 1
							})
						}
					})
				} else {
					uni.showModal({
						title: '提示',
						content: '您还未输入任何内容！'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.toConfirm {
		position: fixed;
		width: 100%;
		bottom: 60rpx;
		left: 0;
		display: flex;
		justify-content: center;

		.btn-confirm {
			padding: 12rpx 0;
			background-color: #386fff;
			font-size: 28rpx;
			color: #fff;
			border-radius: 30rpx;
			letter-spacing: 1px;
			width: 600rpx;
			text-align: center;
		}
	}
</style>